<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../lib/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="firstName">
        <input type="text" v-model="lastName">
        <input type="text" v-model="fullName">
    </div>

    <script>
    var vm = new Vue({
        el:'#app',
        data:{
            firstName:'',
            lastName:''
        },
        methods: {
            
        },
        // 用来定义计算属性 本质上是方法 当作属性来用 并且不能与data中属性重复  结果会缓存
        // 适合做简单逻辑计算
        computed: {
            'fullName':function(){
                return this.firstName + this.lastName
            }
        }
    })
    </script>
</body>
</html>